<div id="tabsdetail">
  <div class="tabcontents">
    <form action="<?php echo base_url; ?>index.php?mod=report&act=search_costs" method="post">
      <div class="hd">
      <link rel="stylesheet" type="text/css" href="<?php echo base_url?>public/styles/jquery-ui.css" >
      <script  type="text/javascript" src="<?php echo base_url;?>public/scripts/jquery-ui.min.js"></script>
  
        <h2>danh sách hóa Nhập</h2>
        <script type="text/javascript">
		    $(function() {
		      $( "#from_date" ).datepicker();
			    $( "#to_date" ).datepicker();
		    });
	    </script>
        <div class="sub-form">
          <label>Từ Ngày
            <input type="text" id="from_date" name="from_date" value="<?php if(isset($data['from']) && $data['from'] != NULL){ echo $data['from'];} ?>" size="28" />
          </label>
        </div>
        <div class="sub-form">
          <label>Đến ngày
            <input type="text" id="to_date" name="to_date" value="<?php if(isset($data['to']) && $data['to'] != NULL){ echo $data['to'];} ?>" size="28" />
            <button name="ok" type="submit"><img src="public/images/search.png" alt=""></button>
          </label>
        </div>
        <table>
          <thead>
            <tr>
              <th width="85">Mã hóa đơn</th>
              <th>Tổng tiền</th>
              <th>Ngày lập</th>
              <th>Người lập</th>
              <th>Ghi chú</th>
            </tr>
          </thead>
          <tbody>
          <?php
		  	$total = 0;
          	if(isset($data['list']) && $data['list'] != NULL){
				$stt = 0;
				foreach($data['list'] as $items){
					$stt++;
					echo "<tr class='second'>";
					echo "<td>#".$items['id']."</td>";
					echo "<td>".@number_format($items['giatien'])." VNĐ</td>";
					$date = date("d-m-Y",$items['ngaylap']);
					echo "<td>".$date."</td>";
					echo "<td>".$items['ten']."</td>";
					echo "<td>".$items['ghichu']."</td>";
					echo "</tr>";
					$total = $total +  $items['giatien'];
					}
			 echo "<tr>";
              echo "<td width='200' style='background: #75401a; color:#FFF;text-transform: uppercase; '> Tổng chi phí:</td>";
              echo "<td colspan='7' style='color: #75401a;'>".@number_format($total)." VNĐ</td>";
             echo "</tr>";
				}else{
					echo "<tr>";
					echo "<td colspan='7'>Không có dữ liệu</td>";
					echo "</tr>";
				}
			?>
          </tbody>
        </table>
        <div id="pagination"><?php echo $data['pagelist'];?></div>
      </div>
      <ul class="add bh" style="margin-right: 40%;">
        <li><a href="javascript:window.print();">In</a></li>
        <!--li><a href="">Sửa</a></li>
        <li><a href="">Xóa</a></li-->
      </ul>
    </form>
  </div>
  
</div>